<!DOCTYPE html>
<html lang="en">

<head>
    <#include "/lx/admin/components/meta.html" />
    <title>活动详情 ${metaTitleSuffix!}</title>
    <#include "/lx/admin/components/stylesheets.html" />
</head>

<body>
    <div id="app">
        <el-container>
            <#assign menuIndex="1-1" />
            <#include "/lx/admin/components/menu.html" />
            <el-container>
                <#include "/lx/admin/components/header.html" />
                <el-main>
                    <template>
                        <el-row>
                            <el-col :span="12">
                                <el-form ref="form" :model="info" label-width="100px">
                                    <el-form-item label="姓名">
                                        <el-input v-model="info.name" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="手机号">
                                        <el-input v-model="info.mobile" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="邮箱">
                                        <el-input v-model="info.email" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="生日">
                                        <el-input v-model="info.birth" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="了解渠道">
                                        <el-input v-model="info.channel" :readonly="true"></el-input>
                                    </el-form-item>
                                </el-form>
                            </el-col>
                            <el-col :span="12">
                                <el-form ref="form" :model="info" label-width="100px">
                                    <el-form-item label="省份">
                                        <el-input v-model="info.province" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="城市">
                                        <el-input v-model="info.city" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="公司">
                                        <el-input v-model="info.companyName" :readonly="true"></el-input>
                                    </el-form-item>
                                    <el-form-item label="职务">
                                        <el-input v-model="info.job" :readonly="true"></el-input>
                                    </el-form-item>
                                </el-form>
                            </el-col>
                        </el-row>
                        <el-row style="margin-bottom: 22px;">
                            <el-col :span="4">
                                <div class="label">上申请季学生递交数</div>
                            </el-col>
                            <el-col :span="8">
                                <el-input v-model="info.prevSubmit" :readonly="true"></el-input>
                            </el-col>
                        </el-row>
                        <el-row style="margin-bottom: 22px;">
                            <el-col :span="4">
                                <div class="label">上申请季学生入读数</div>
                            </el-col>
                            <el-col :span="8">
                                <el-input v-model="info.prevAdopt" :readonly="true"></el-input>
                            </el-col>
                        </el-row>
                        <el-row style="margin-bottom: 22px;">
                            <el-col :span="4">
                                <div class="label">问题</div>
                            </el-col>
                            <el-col :span="8">
                                <el-input v-model="info.question" type="textarea" :autosize="{ minRows: 5 }" :readonly="true"></el-input>
                            </el-col>
                        </el-row>
                        <!-- <el-form ref="form" :model="info" label-width="100px">
                            <el-form-item label="活动内容">
                                <el-input v-model="info.content" type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入内容"></el-input>
                            </el-form-item>
                            <el-form-item label="活动地址">
                                <el-input v-model="info.location" placeholder="请输入活动地址"></el-input>
                            </el-form-item>
                            <el-form-item label="活动URL">
                                <el-input v-model="info.url" placeholder="请输入保利威视直播地址"></el-input>
                            </el-form-item>
                            <el-form-item label="线上/线下">
                                <el-radio-group v-model="info.type">
                                    <el-radio :label="1">线下</el-radio>
                                    <el-radio :label="2">线上</el-radio>
                                </el-radio-group>
                            </el-form-item>
                            <el-form-item label="学校">
                                <el-select v-model="info.schoolId" placeholder="请选择学校">
                                    <el-option v-for="(item, index) in schools" :label="item.name" :value="item.id"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="是否已结束">
                                <el-radio-group v-model="info.isOver">
                                    <el-radio :label="1">是</el-radio>
                                    <el-radio :label="0">否</el-radio>
                                </el-radio-group>
                            </el-form-item>
                            <el-form-item>
                                <el-button type="primary" @click="submit">提交</el-button>
                            </el-form-item>
                        </el-form> -->
                    </template>
                </el-main>
            </el-container>
        </el-container>
        <#include "/lx/admin/components/footer.html" />
    </div>
    <#include "/lx/admin/components/scripts.html" />
    <script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                info: {},
                schools: [],
                datetimeRange: '',
                coverUrl: ''
            }
        },
        watch: {

        },
        mounted: function() {
            this.info = ${info!'{}'}
            this.schools = ${schools!'[]'}
            if (this.info.startTime) {
                this.datetimeRange = new Array;
                this.datetimeRange.push(this.info.startTime);
                this.datetimeRange.push(this.info.endTime);
            }
            if (this.info.cover) {
                this.coverUrl = this.info.cover;
            }
        },
        methods: {
            submit() {
                var self = this;
                if (!self.info.title) {
                    msg("请输入标题");
                    return;
                }
                if (!self.datetimeRange) {
                    msg("请选择时间");
                    return;
                }

                var url = "/lx/admin/activity/submit"
                var param = {
                    id: self.info.id,
                    title: self.info.title,
                    cover: self.coverUrl,
                    // video: self.info.video,
                    startTime: self.datetimeRange[0],
                    endTime: self.datetimeRange[1],
                    content: self.info.content,
                    location: self.info.location,
                    url: self.info.url,
                    type: self.info.type,
                    schoolId: self.info.schoolId,
                    isOver: self.info.isOver
                };
                var success = () => {
                    window.location.href = "/lx/admin/activity/list";
                }
                var fail = () => {
                    msg(response.data.msg);
                }
                var complete = () => {}
                axiosRequestPro(url, param, success, fail, complete);
            },
            removeImg(file, fileList) {
                this.coverUrl = "";
            },
            successImg(response, file, fileList) {
                endLoading();
                this.coverUrl = response.info.url;
            },
            errorImg(err, file, fileList) {
                endLoading();
                msg('上传图片失败')
            },
            onProgress() {
                loading();
            }
        }
    })
    </script>
    <style type="text/css">
    .title {
        font-size: 18px;
        font-weight: bold;
    }

    .label {
        width: 100%;
        text-align: right;
        float: left;
        font-size: 14px;
        color: #606266;
        line-height: 40px;
        padding: 0 12px 0 0;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }

    input[type="file"] {
        display: none !important;
    }

    .image-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }

    .image-uploader .el-upload:hover {
        border-color: #409EFF;
    }

    .image-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 178px;
        height: 178px;
        line-height: 178px;
        text-align: center;
    }

    .image {
        width: 178px;
        height: 178px;
        display: block;
    }
    </style>
    <#include "/lx/admin/components/msg.html" />
</body>

</html>